Computers include general purpose central processing units (CPUs) that execute a specific set of system instructions. A group of processors that have similar architecture or design specifications are referred to as a processor family. Examples of processor families are the MOTOROLA® 680X0 family, manufactured by Motorola, Inc. of Phoenix, Ariz.; the INTEL® 80X86 family, manufactured by INTEL® Corporation of Sunnyvale, Calif.; and the POWERPC® family, manufactured by Motorola, Inc. and used in computers manufactured by APPLE COMPUTER®, Inc. of Cupertino, Calif. Although a group of processors may be in the same family because of their similar architecture, processors may vary widely, even within a family, according to their clock speed and other performance parameters.
Each microprocessor family executes instructions that are unique to the processor family. The collective set of instructions that a processor can execute is known as the processor's instruction set. For example, the instruction set used by the INTEL® 80X86 processor family is incompatible with the instruction set used by the POWERPC® processor family. The INTEL® 80X86 instruction set is based on the Complex Instruction Set Computer (CISC) format. The MOTOROLA POWERPC® instruction set is based on the Reduced Instruction Set Computer (RISC) format. CISC processors use a large number of instructions, some of which can perform rather complicated functions, but which require generally many clock cycles to execute. RISC processors use a smaller number of available instructions to perform a simpler set of functions that are executed at a higher rate.
The uniqueness of the processor family among computer systems also typically results in tailoring of software, such as operating system software, for a particular processor or processor family. Furthermore, other hardware elements of computer systems may be tailored for a particular processor or processor family. For example, a computer system manufactured with a processor from the INTEL® 80X86 processor family will have a hardware architecture that is different from the hardware architecture of a computer system manufactured with a processor from the POWERPC® processor family. An operating system designed for use with the INTEL® 80X86 processor and corresponding hardware may not function on a computer with the POWERPC® processor and corresponding hardware. Because of the uniqueness of the processor instruction set, hardware architecture, and operating system, application software programs are typically written to run on a particular computer system platform running a particular operating system.
A computer manufacturer will want to maximize its functionality by having more rather than fewer applications run on the microprocessor family associated with the computer manufacturer's product line. Likewise, software engineers benefit from wide usability of their software regardless of platform. To expand the number of operating systems and application programs that can run on a computer system, a field of technology has developed in which a given computer having a first operating system adapted for the particular system hardware, called a host, will run an emulator program that receives and executes instructions intended for some other system hardware configuration. Software, such as a second operating system, that is designed for the other system hardware configuration can then execute via the emulator program. Such an operating system is referred to as a guest operating system. Thus, the host will execute an application that will cause one or more host instructions to be called in response to a given guest instruction.
In some cases, the host can both run software designed for its own hardware architecture, other than the emulation program, and software written for computers having an unrelated hardware architecture. As a more specific example, a computer system manufactured by APPLE COMPUTER®, for example, may run operating systems and programs written for PC-based computer systems. It may also be possible to use an emulator program to concurrently operate multiple operating systems designed for different processor families on a single CPU. In this arrangement, although some operating systems may not be natively compatible with the system hardware, an emulator program can host one or more operating systems, allowing the otherwise incompatible operating systems to run concurrently on the same computer system.
When a computer system other than the native system is emulated by a host operating system, a guest operating system that executes via the emulated hardware is sometimes referred to as a virtual machine, as the guest operating system is insulated from the actual hardware architecture of the native computer system. Thus a virtual machine can comprise a guest operating system that executes via emulated hardware. As an example, the VIRTUAL PC® software marketed by MICROSOFT® Corp. of Redmond, Wash. emulates an entire computer that includes an INTEL® 80X86 Pentium processor and various motherboard components and cards. The operation of these components is emulated for the use of a virtual machine that is being supported by the host operating system which controls the native computer system.
An emulator program executing on the host operating system software and hardware architecture, such as a computer system having a POWERPC® processor, can mimic the operation of an entire computer system. The emulator program acts as the interchange between the hardware architecture of the host machine and the instructions transmitted by software running within the emulated environment. Thus, when a virtual machine is running, there are effectively two operating systems that share the host system hardware: the host operating system, and the guest operating system.
One advantage of a virtual machine over a real machine is the ability to quickly and cheaply create multiple instances of virtual machines. If allowed by the virtual machine implementation, multiple virtual machines can exist simultaneously in a single host machine (host computer system) environment. Resources of the host machine can be divided among the various virtual machines. For example, a single host machine with four processors and one gigabyte of random access memory (RAM) could be divided evenly into four virtual machines, each of which is given one processor and 256 megabytes of RAM. Other resource allocation divisions are possible.
This flexible resource allocation becomes even more useful when combined with the ability to move virtual machines from one host machine to another. This allows for “load balancing” of systems. For example, if a virtual machine requires more processing power than is available on one host machine, it can be moved to another host machine that has extra capacity.
Like the host computer system, the guest computer system can control, communicate with, and receive commands from hardware devices that are electronically coupled to the host system. Representing device functionality inside virtual machines is often accomplished by emulating a hardware device in software. Host-side emulation maps the features of emulated devices in a guest onto features supported by the physical devices in a host. While proper device emulation can deliver a high degree of compatibility, emulated devices often suffer from poor performance and their functionality is not easily extended. Modifications that deviate from the implementation of the original physical device often erode compatibility. Emulated hardware implementations are often unable to take advantage of increasing host-side hardware capabilities.
Furthermore, when a device fails, and a redundant device is waiting in reserve, the host computer system may be able to take advantage of the reserve device while the guest cannot, because, while the functions of the original device were emulated in the guest and mapped to corresponding features of the physical device, the functions of the reserve device may be somewhat different. Likewise, the host computer may support “hot swapping” of devices, such as by using the Advanced Configuration and Power Interface (ACPI) or Standard Hot Plug Configuration (SHPC) PCI standards, while the guest computer system may not. When one device is swapped for another, the guest may no longer be able to use the device.
Migration of a virtual machine can be problematic if the hardware in the destination host does not closely match the source host hardware. Virtual machines, whether in saved state or during a live migration, may contain instantiated device stacks for the specific devices projected by the originating host. When these stacks are transferred to a new host with different hardware, the stack instructions fail.
Device conflicts between the various machines attempting to use a particular device may also occur. Operating system device managing architectures are built with the assumption that there is a single instance of the system and that instance is the mediator of all entities accessing the device. This is not the case in a virtual machine environment when a physical device is shared across multiple operating systems. Conflicts arise between multiple operating systems that assume exclusive ownership of a device.
In view of the foregoing difficulties in sharing devices among multiple operating systems in a virtual machine arrangement, there is a need in the industry to improve present techniques for such sharing.